FIND_PATH(FFMPEG_INCLUDE_DIR libavcodec/avcodec.h
  "{INCLUDE}"
  "{LIB_DIR}/include"
)

FIND_LIBRARY(FFMPEG_LIBAVCODEC_LIBRARIES NAMES avcodec PATHS
  "{LIB}"
  "{LIB_DIR}/lib"
)
FIND_LIBRARY(FFMPEG_LIBAVDEVICE_LIBRARIES NAMES avdevice PATHS
  "{LIB}"
  "{LIB_DIR}/lib"
)
FIND_LIBRARY(FFMPEG_LIBAVFILTER_LIBRARIES NAMES avfilter PATHS
  "{LIB}"
  "{LIB_DIR}/lib"
)
FIND_LIBRARY(FFMPEG_LIBAVFORMAT_LIBRARIES NAMES avformat PATHS
  "{LIB}"
  "{LIB_DIR}/lib"
)
FIND_LIBRARY(FFMPEG_LIBAVUTIL_LIBRARIES NAMES avutil PATHS
  "{LIB}"
  "{LIB_DIR}/lib"
)
FIND_LIBRARY(FFMPEG_LIBSWRESAMPLE_LIBRARIES NAMES swresample PATHS
  "{LIB}"
  "{LIB_DIR}/lib"
)
FIND_LIBRARY(FFMPEG_LIBSWSCALE_LIBRARIES NAMES swscale PATHS
  "{LIB}"
  "{LIB_DIR}/lib"
)

SET(FFMPEG_LIBRARY
  ${FFMPEG_LIBAVCODEC_LIBRARIES}
  ${FFMPEG_LIBAVDEVICE_LIBRARIES}
  ${FFMPEG_LIBAVFILTER_LIBRARIES}
  ${FFMPEG_LIBAVFORMAT_LIBRARIES}
  ${FFMPEG_LIBAVUTIL_LIBRARIES}
  ${FFMPEG_LIBSWRESAMPLE_LIBRARIES}
  ${FFMPEG_LIBSWSCALE_LIBRARIES}
)

IF (FFMPEG_INCLUDE_DIR AND FFMPEG_LIBRARY)
  SET(FFMPEG_FOUND TRUE)
ENDIF (FFMPEG_INCLUDE_DIR AND FFMPEG_LIBRARY)
